#!/bin/bash

DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"

function error {
  echo -e "\\e[91m$1\\e[39m"
  exit 1
}

cd $HOME

wget -O ~/.local/share/Quartz_Browser.AppImage 'https://github.com/ksharindam/quartz-browser-qt5/releases/download/v2.3.7/Quartz_Browser-armhf.AppImage'

chmod u+x ~/.local/share/Quartz_Browser.AppImage

echo "[Desktop Entry]
Type=Application
Name=Quartz Browser
Comment=Light weight web browser
Categories=Network;WebBrowser
Exec=bash -c 'sudo modprobe fuse; ~/.local/share/Quartz_Browser.AppImage '"'\ "%U"'"
Icon=$(dirname "$0")/icon-64.png
StartupWMClass=Quartz-Browser" > ~/.local/share/applications/quartz-browser.desktop
